﻿using FPSO.Models.Constant;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FPSO.Models.Domain
{
    [SugarTable("t_instruct_log")]
    public class InstructLog
    {
        public InstructLog()
        {
            InsId = 0;
            TaskId = 0;
            TaskQueue = 0;
            InsState = 0;
            TankId = "";
            TargetLevel = 0;
            TaskType = 0;
            TankType = 0;
            TaskOp = 0;
            CreateTime = DateTime.MinValue;
            SendTime = DateTime.MinValue;
            UpdateTime = DateTime.MinValue;
        }

        /// <summary>
        /// 指令日志ID
        /// </summary>
        [SugarColumn(ColumnName ="ins_id", IsPrimaryKey = true, IsIdentity = true)]
        public int InsId { get; set; }

        /// <summary>
        /// 任务ID
        /// </summary>
        [SugarColumn(ColumnName = "task_id")]
        public int TaskId { get; set; }

        /// <summary>
        /// 任务队列
        /// </summary>
        [SugarColumn(ColumnName ="task_queue")]
        public int TaskQueue { get; set; }

        /// <summary>
        /// 指令状态，0 创建指令, 1下发指令, 2 下发成功， 3 下位机读取成功 4 执行成功  ,   
        ///          11 下发失败， 12 下位机读取失败  13 执行超时  14 执行失败
        /// </summary>
        [SugarColumn(ColumnName = "ins_state")]
        public int InsState { get; set; }

        /// <summary>
        /// 舱室ID
        /// </summary>
        [SugarColumn(ColumnName = "tank_id")]
        public string TankId { get; set; }

        /// <summary>
        /// 目标液位
        /// </summary>
        [SugarColumn(ColumnName = "target_level")]
        public double TargetLevel { get; set; }

        /// <summary>
        /// 任务类型，1 装，2 卸，3 倒舱
        /// </summary>
        [SugarColumn(ColumnName = "task_type")]
        public int TaskType { get; set; }

        /// <summary>
        /// 舱室类型，0 油舱， 1 压载舱
        /// </summary>
        [SugarColumn(ColumnName = "tank_type")]
        public int TankType { get; set; }

        /// <summary>
        /// 操作 1-3
        /// </summary>
        [SugarColumn(ColumnName = "task_op")]
        public int TaskOp { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "create_time")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        [SugarColumn(ColumnName = "send_time")]
        public DateTime SendTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnName = "update_time")]
        public DateTime UpdateTime { get; set; }
    }
}
